package com.haierCamera.customapplication.ui.login;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import androidx.databinding.DataBindingUtil;

import com.haierCamera.customapplication.BaseActivity;
import com.haierCamera.customapplication.R;
import com.haierCamera.customapplication.databinding.HzklActivityWelcomeBinding;
import com.haierCamera.customapplication.ui.MainActivity;
import com.haierCamera.customapplication.utils.android.SystemUIHelper;

public class HZKLWelcomeActivity extends BaseActivity {
    private HzklActivityWelcomeBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /*if (!isTaskRoot()) {
            return;
        }*/
        if (!this.isTaskRoot()) {
            Intent mainIntent = getIntent();
            String action = mainIntent.getAction();
            if (mainIntent.hasCategory(Intent.CATEGORY_LAUNCHER) && Intent.ACTION_MAIN.equals(action)) {
                finish();
                return;
            }
        }
        SystemUIHelper.setFullWindowNew(getWindow());
        binding = DataBindingUtil.setContentView(this, R.layout.hzkl_activity_welcome);
        initData();
    }

    private void initData() {
        new Handler().postDelayed(() -> {
            startActivity(new Intent(HZKLWelcomeActivity.this, MainActivity.class));
            finish();
        }, 2000);
    }
}
